package com.qingkai.onlineshop.presentation.detail

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.qingkai.onlineshop.data.entity.ItemEntity
import com.qingkai.onlineshop.presentation.dashboard.testItemEntity

/**
 *作者：created by 89270 on 2025/6/16 11:51
 *描述：
 */
@Composable
fun ItemInfo(modifier: Modifier = Modifier, itemEntity: ItemEntity) {
    Column(
        modifier = modifier
    ) {
        Text(
            text = itemEntity.title,
            style = MaterialTheme.typography.titleLarge,
            fontWeight = FontWeight.Bold,
            color = MaterialTheme.colorScheme.onSecondaryContainer
        )
        Text(
            text = "Product Detail",
            style = MaterialTheme.typography.titleSmall,
            fontWeight = FontWeight.Bold,
            color = MaterialTheme.colorScheme.onSecondaryContainer,
            modifier = Modifier.padding(vertical = 16.dp)
        )
        Text(
            text = itemEntity.description,
            style = MaterialTheme.typography.bodyMedium,
            color = Color.Gray,
            fontWeight = FontWeight.Bold,
        )
    }
}

@Preview(showBackground = true)
@Composable
fun ItemInfoPreview() {
    ItemInfo(modifier = Modifier, testItemEntity)
}